#ifndef ALIYUN_CLIENT_H
#define ALIYUN_CLIENT_H

/* 超时上报时间 */
#define ALIYUN_UPDATE_MAX_WAIT_TIME 10000

/* 连接WIFI和密码 */
#define WIFI_SSID "415"
#define WIFI_PASSWD "415yesyes"

/* 三元组信息*/
#define PRODUCT_KEY "a1Hl6KJtzyJ"
#define DEVICE_NAME "cup3"
#define DEVICE_SECRET "6c0bfd7d35db28f09ae218f917d07485"
#define REGION_ID "cn-shanghai"

/* MQTT 连接参数 */
#define CLIENT_ID "a1Hl6KJtzyJ.cup3|securemode=2,signmethod=hmacsha256,timestamp=1715603858968|"
#define MQTT_PASSWD "fb3ec7036a3f014d429cf31002a58ce0818e64ac1b761aa87bb16556fc63f2f5"

/* 线上环境域名和端口号 */
#define MQTT_SERVER PRODUCT_KEY ".iot-as-mqtt." REGION_ID ".aliyuncs.com"
#define MQTT_PORT 1883
#define MQTT_USRNAME DEVICE_NAME "&" PRODUCT_KEY

// 宏定义订阅主题
#define ALINK_BODY_FORMAT "{\"id\":\"" DEVICE_NAME "\",\"version\":\"1.0\",\"method\":\"thing.event.property.post\",\"params\":%s}"
#define ALINK_TOPIC_PROP_POST "/sys/" PRODUCT_KEY "/" DEVICE_NAME "/thing/event/property/post"


#define TEMPERATURE "temperature"
#define QUANTITY_MM "WaterRequire"

void mqtt_init();
int mqttCheckConnect();
void aliyun_mqtt_send_data(char *target, float data);
void aliyun_mqtt_send_data(char *target, int data);
void aliyun_mqtt_send_data(char *target, char *data);

#endif
